package com.aoyy.service;

import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.aoyy.model.Board;
import com.aoyy.dao.ForumDao;
import com.aoyy.util.Page;
/**========================================================================================
 * Forum service <code>ForumService</code>
 * @see com.aoyy.dao.ForumDao
 * @author this author
 * @date 2017-08-14
 * ======================================================================================== */
@Service
public class ForumService {
	@Autowired
	private ForumDao forumDao;
	
	public void setForumDao(ForumDao forumDao) {
		this.forumDao = forumDao;
	}
	
	public ForumDao getForumDao() {
		return forumDao;
	}
	
	// Query all boards
	public List<Board> queryAllBoards() {
		return forumDao.loadAll();
	}
	
	// Query boards by page 
	public Page pagedQuery(int pageNo, int pageSize) {
		return forumDao.pagedQuery(pageNo, pageSize);		
    }	

}
